<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>投诉表扬</title>
    <link rel="stylesheet" type="text/css" href="/CMS/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="/CMS/css/express.css"/>
    <link rel="stylesheet" type="text/css" href="/CMS/css/pictureViewer.css"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/DefaultSkin.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/load.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/control.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/list.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/anim.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/page.css?v=1.0"/><!-- 这个里面有字体,加个版本号不进行更新 -->
    <link rel="stylesheet" type="text/css" href="/IMS/css/comm.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/select2/select2.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/zTreeStyle/zTreeStyle.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/core.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/js/plugins/file/uploadify/uploadify.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/js/plugins/treeview/jquery.treeview.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/multi-select.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/js/plugins/bsgrid/bsgrid.all.min.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/js/plugins/bsgrid/bsgrid.all.min.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/jeasy-ui/easyui.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css"
          href="/IMS/js/plugins/poshytip/tip-darkgray/tip-darkgray.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/addinfo.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/prettyPhoto.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/jquery-ui-1.10.4.custom.min.css?v=20180712190507493"/>
    <link rel="stylesheet" type="text/css" href="/IMS/css/jquery.editable-select.min.css?v=20180712190507493"/>
    <script type="text/javascript" src="/IMS/js/jquery-1.11.2.min.js?v=20180712190507542"></script>
    <!-- 新增加 -->
    <script type="text/javascript" src="/IMS/js/plugins/comm/jquery-ajax.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/comm/securityProtect.js?v=20180712190507542"></script>
    <script type="text/javascript"
            src="/IMS/js/plugins/comm/jquery-ajax-response-handler.js?v=20180712190507542"></script>
    <!-- 新增加 END -->
    <script type="text/javascript" src="/IMS/js/common/public-obj.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/common/bind.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/common/controls.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/common/slide.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/common/switch.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/common/initial.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/common/print/printhtml.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/common/listBox.js?v=20180712190507542"></script>

    <script type="text/javascript" src="/IMS/js/plugins/My97DatePicker/WdatePicker.js?v=20180712190507542"></script>
    <script type="text/javascript"
            src="/IMS/js/plugins/file/uploadify/jquery.uploadify.min.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/layer/layer.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/select2/select2.full.min.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/select2/i18n/zh-CN.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/treeview/jquery.treeview.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/form/jquery.form.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/ztree/jquery.ztree.core-3.5.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/ztree/jquery.ztree.excheck-3.5.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/comm/constant.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/comm/common.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/comm/bmsAjax.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/comm/validata.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/validate/jquery.validate.js?v=20180712190507542"></script>
    <script type="text/javascript"
            src="/IMS/js/plugins/validate/localization/messages_zh.min.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/validate/regValidate.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/common/popup_layer.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/common/jqueryPlugins/jquery_magnifier.js?v=20180712190507542"></script>
    <script type="text/javascript"
            src="/IMS/js/common/jqueryPlugins/jquery.multi-select.js?v=20180712190507542"></script>
    <script type="text/javascript"
            src="/IMS/js/common/jqueryPlugins/jquery.quicksearch.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/jquery.easyui.min.js?v=20180712190507542"></script>
    <script type="text/javascript"
            src="/IMS/js/common/jqueryPlugins/jquery.prettyPhoto.js?v=20180712190507542"></script>

    <script type="text/javascript" src="/IMS/js/plugins/bsgrid/grid.zh-CN.min.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/bsgrid/bsgrid.all.min.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/bsgrid/grid.extend.min.js?v=20180712190507542"></script>
    <script type="text/javascript" charset="UTF-8"
            src="/IMS/js/plugins/poshytip/jquery.poshytip.js?v=20180712190507542"></script>

    <script type="text/javascript"
            src="/IMS/js/common/jqueryPlugins/jquery-ui-1.10.4.custom.min.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/common/joinUs/AddListBox.js?v=20180712190507542"></script>
    <script type="text/javascript"
            src="/IMS/js/common/jqueryPlugins/jquery.editable-select.min.js?v=20180712190507542"></script>

    <!-- echarts -->
    <script type="text/javascript" src="/IMS/js/plugins/echarts/dist/echarts.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/echarts/dist/chart/bar.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/echarts/dist/chart/line.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/echarts/dist/chart/pie.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/echarts/dist/chart/funnel.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/IMS/js/plugins/echarts/dist/chart/funnel.js?v=20180712190507542"></script>
    <script type="text/javascript" src="/CMS/js/express/index.js"></script>
    <script type="text/javascript" src="/CMS/js/express/index.js"></script>
    <script type="text/javascript" src="/CMS/js/express/pictureViewer.js"></script>

</head>

<body>
<div>
    <div class="icip_title_box" style="margin-bottom: 20px;">
        <div class="left">
            <span class="icip_title_text" style="margin-left: 20px;">投诉表扬</span>
        </div>
         <div class="right">
            <span class="refresh" style="margin-right: 60px;">
				<a class="btn btn-default" href="/CMS/complaint/complaint.ht">刷新</a>
			</span>
        </div>
        <!--<div class="right">
			<span class="icip_button icip_button_c2">
				<a href="/CMS/express/addexpress.ht" style="color: white;">录入快递</a>
			</span>
        </div>-->
    </div>
</div>
<div class="container express-box">
    <div class="row">
        <table id='tabletest' class="table table-hover express-table" style="width: 100%;margin-bottom: 0;table-layout: fixed;">
             <col width="5%" />
            <col width="15%" />
              <col width="35%" />
            <col width="10%" />
              <col width="30%" />
            <col width="5%" />
            <tr>
                <th width="5%">类型</th>
                <th width="25%">地址</th>
                <th width="35%">内容</th>
                <th width="10%">时间</th>
                <th width="30%">图片</th>
                <th width="5%">操作</th>
            </tr>
            <!--<tr class="comp-main">
                <td >警告</td>
                <td>济南万达金街</td>
                <td>街内垃圾未清理</td>
                <td>10:25:56</td>
                <td></td>
                <td><input class="delete-btn btn btn-default" type="button" name="" id="" value="删除"/></td>
            </tr>
            -->
        </table>
        <div class="none-text">暂无数据</div>
    </div>
</div>
</body>
<script type="text/javascript">
    $(function () {
        $.ajax({
            url: '/CMS/complaint/selcomplaint.ht',
            type: 'get',
            dataType: 'json',
            success: function (data) {
                //   var dataObj = result;
                console.log(data)
                $.each(data.data, function (index, item) {
                    var tr;
                    tr = '<td width="5%">' + item.strType + '</td>' + '<td width="25%">' + item.strComName + '</td>' + '<td  width="25%">' + item.strContent + '</td>' + '<td width="10%">' + item.strCreatetime + '</td>' + '' +
                        '<td class="image-list" width="30%">' +'<div class="cover">'+
                        '<img onerror="this.style.display=\'none\';" style="width:50px;height:50px;margin-right: 10px;" src=' + item.strImg01 + '>'+'</div>'+'<div class="cover">'+
                        '<img onerror="this.style.display=\'none\';" style="width:50px;height:50px;margin-right: 10px;" src=' + item.strImg02 + '>'+'</div>' +'<div class="cover">'+
                        '<img onerror="this.style.display=\'none\';" style="width:50px;height:50px;margin-right: 10px;" src=' + item.strImg03 + '>'+'</div>'+'</td>'
                        + '<td width="5%"><input onclick="deleteItem('+item.strId+',this)" class="delete-btn btn btn-default" type="button" name="strId" id="" value="删除"/></td>'+'<div class="cover"></div>';
                    $("#tabletest").append('<tr>' + tr + '</tr>');
                    var imgsrc=$(".image-list img").attr("src");


                         $('.cover').each(function () {
                             var imgsrc = $(this).find("img").attr("src");

                             if (imgsrc=='') {
                               $(this).remove();
                             }
                         })

                });
               $('.image-list').on('click', '.cover', function() {
					var this_ = $(this);
					var images = this_.parents('.image-list').find('.cover');
					var imagesArr = new Array();
					$.each(images, function(i, image) {
						imagesArr.push($(image).children('img').attr('src'));
					});
					console.log(this_.index())
					$.pictureViewer({
						images: imagesArr, //需要查看的图片，数据类型为数组
						initImageIndex: this_.index()+1 , //初始查看第几张图片，默认1
						scrollSwitch: true, //是否使用鼠标滚轮切换图片，默认false

					});
				});
            }

        })

    });


    function deleteItem(strId, obj) {
        console.log(strId);
        //return false;
        if (confirm("确定要删除吗？")) {
            window.event.returnValue = true;
        } else {
            window.event.returnValue = false;
        }
        if (window.event.returnValue == true) {
            //测试参数
            $.ajax({
                url: '/CMS/complaint/delcomplaint.ht?strId=' + strId,   //这是get 传参
                type: 'get',
                dataType: 'json',
                success: function (result) {
                    var dataObj = result;
                    //成功之后删除当前条目
                    alert("删除成功!")
                    $(obj).parent("td").parent("tr").remove();
                },
                error: function () {
                    alert("删除失败!")
                }
            })
        }
    }



</script>
</html>